<?php


namespace SaaS\Services;


use Exception;
use SaaS\Models\SaaSTenant;

class SaaSService
{
    public static function create(string $tenant_id): bool
    {
        try {
            $tenant = SaaSTenant::create(['id' => $tenant_id]);
            $tenant->domains()->create(['domain' => $tenant_id . '.' . config('tenancy.central_domains')[0]]);
            
            return true;
        } catch (Exception $exception) {
            return false;
        }
    }
}
